const SF: [[i32; 4]; 100] = [
    [2000, 2, 5, 2],
    [2001, 1, 24, 0],
    [2002, 2, 12, -1],
    [2003, 2, 1, -2],
    [2004, 1, 22, -3],
    [2005, 2, 9, 2],
    [2006, 1, 29, 1],
    [2007, 2, 18, 0],
    [2008, 2, 7, -1],
    [2009, 1, 26, -3],
    [2010, 2, 14, 3],
    [2011, 2, 3, 2],
    [2012, 1, 23, 1],
    [2013, 2, 10, -1],
    [2014, 1, 31, -2],
    [2015, 2, 19, -3],
    [2016, 2, 8, 3],
    [2017, 1, 28, 1],
    [2018, 2, 16, 0],
    [2019, 2, 5, -1],
    [2020, 1, 25, -2],
    [2021, 2, 12, 3],
    [2022, 2, 1, 2],
    [2023, 1, 22, 1],
    [2024, 2, 10, 0],
    [2025, 1, 29, -2],
    [2026, 2, 17, -3],
    [2027, 2, 6, 3],
    [2028, 1, 26, 2],
    [2029, 2, 13, 0],
    [2030, 2, 3, -1],
    [2031, 1, 23, -2],
    [2032, 2, 11, -3],
    [2033, 1, 31, 2],
    [2034, 2, 19, 1],
    [2035, 2, 8, 0],
    [2036, 1, 28, -1],
    [2037, 2, 15, -3],
    [2038, 2, 4, 3],
    [2039, 1, 24, 2],
    [2040, 2, 12, 1],
    [2041, 2, 1, -1],
    [2042, 1, 22, -2],
    [2043, 2, 10, -3],
    [2044, 1, 30, 3],
    [2045, 2, 17, 1],
    [2046, 2, 6, 0],
    [2047, 1, 26, -1],
    [2048, 2, 14, -2],
    [2049, 2, 2, 3],
    [2050, 1, 23, 2],
    [2051, 2, 11, 1],
    [2052, 2, 1, 0],
    [2053, 2, 19, -2],
    [2054, 2, 8, -3],
    [2055, 1, 28, 3],
    [2056, 2, 15, 2],
    [2057, 2, 4, 0],
    [2058, 1, 24, -1],
    [2059, 2, 12, -2],
    [2060, 2, 2, -3],
    [2061, 1, 21, 2],
    [2062, 2, 9, 1],
    [2063, 1, 29, 0],
    [2064, 2, 17, -1],
    [2065, 2, 5, -3],
    [2066, 1, 26, 3],
    [2067, 2, 14, 2],
    [2068, 2, 3, 1],
    [2069, 1, 23, -1],
    [2070, 2, 11, -2],
    [2071, 1, 31, -3],
    [2072, 2, 19, 3],
    [2073, 2, 7, 1],
    [2074, 1, 27, 0],
    [2075, 2, 15, -1],
    [2076, 2, 5, -2],
    [2077, 1, 24, 3],
    [2078, 2, 12, 2],
    [2079, 2, 2, 1],
    [2080, 1, 22, 0],
    [2081, 2, 9, -2],
    [2082, 1, 29, -3],
    [2083, 2, 17, 3],
    [2084, 2, 6, 2],
    [2085, 1, 26, 0],
    [2086, 2, 14, -1],
    [2087, 2, 3, -2],
    [2088, 1, 24, -3],
    [2089, 2, 10, 2],
    [2090, 1, 30, 1],
    [2091, 2, 18, 0],
    [2092, 2, 7, -1],
    [2093, 1, 27, -3],
    [2094, 2, 15, 3],
    [2095, 2, 5, 2],
    [2096, 1, 25, 1],
    [2097, 2, 12, -1],
    [2098, 2, 1, -2],
    [2099, 1, 21, -3],
];

pub fn time_info(time: &str) -> String {
    // 2024-11-18
    let year = time[0..4].parse::<usize>().unwrap() - 2000;
    let month = time[5..7].parse::<i32>().unwrap();
    let day = time[8..10].parse::<i32>().unwrap();
    let mut result = String::new();
    let mut day_of_month: [i32; 13] = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
    if year % 4 == 0 && year % 100 != 0 || year % 400 == 0 {
        day_of_month[2] = 29;
    }
    // week of the year
    if month == 12 && day - SF[year + 1][3] > 31 {
        result.push_str("1");
    } else {
        let mut passed_day = 0;
        for i in 1..=12usize {
            if i as i32 == month {
                passed_day += day;
                break;
            }
            passed_day += day_of_month[i];
        }
        result.push_str(&format!("{}", (passed_day - 1 - SF[year][3]) / 7 + 1));
    }

    // left days of the year
    let mut left = 0;
    for i in 1..=12usize {
        if i as i32 == month {
            left += day_of_month[i] - day;
        }
        if i as i32 > month {
            left += day_of_month[i];
        }
    }
    result.push_str(&format!(",{}", left));

    let mut next = 0;
    // days to spring festival
    if month < SF[year][1] || month == SF[year][1] && day < SF[year][2] {
        // this year
        for i in month as usize..=12usize {
            if i as i32 == SF[year][1] {
                next += SF[year][2] - day - 1;
                break;
            }
            next += day_of_month[i];
        }
    } else {
        // next year
        next = left;
        for i in 1..=12usize {
            if i as i32 == SF[year + 1][1] {
                next += SF[year + 1][2] - 1;
                break;
            }
            next += day_of_month[i];
        }
    }
    result.push_str(&format!(",{}", next));
    return result;
}
